Explain all arrays in Python ?
Array in python
1223
03-Jul-2018
Updated on 03-Jul-2018
Prakash nidhi Verma
03-Jul-2018Python Collections (Arrays) :
There are four data types in the Python Array:
1. List : ordered,changeable, duplicate members.
Ex.
2. Tuple : ordered,unchangeable,duplicate members.
Ex:
thistuple = ("apple", "banana", "cherry")print(thistuple)
3. Set : unordered, unindexed,No duplicate members.
ex.
thisset = {"apple", "banana", "cherry"}print(thisset)
4. Dictionary :unordered, changeable, indexed,No duplicate members.
ex.
thisdict = {"apple": "green",
"banana": "yellow",
"cherry": "red"
}
print(thisdict)